package com.example.miaosha.mapper;

import com.example.miaosha.entity.SequenceInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Created by lerry_li on 2020/10/22
 */
@Mapper
public interface SequenceInfoMapper {
    @Select("SELECT * FROM sequence_info WHERE name = #{name}")
    SequenceInfo getSequenceInfoByName(String name);

    @Update("UPDATE sequence_info SET current_value = #{currentValue}," +
            "step = #{step} WHERE name = #{name}")
    int updateByPrimaryKey(SequenceInfo record);
}
